package app.hanxiao.com.demo.push;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;

import app.hanxiao.com.demo.R;
import app.hanxiao.com.demo.push.server.PushServer;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class PushActivity extends AppCompatActivity {
    private static final String TAG = "PushServer";
    @BindView(R.id.address)
    EditText address;
    @BindView(R.id.port)
    EditText port;
    @BindView(R.id.sure)
    Button sure;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_push);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.sure)
    public void onClick() {
        Log.d(TAG,"开始启动服务 ====>  ");
        Intent intent = new Intent(PushActivity.this,PushServer.class);
        intent.putExtra("ADDRESS",address.getText().toString());
        intent.putExtra("PORT",Integer.parseInt(port.getText().toString()));
        startService(intent);

    }
}
